package com.ruoyi.project.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.business.domain.BusinessFarmServiceOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.mapper.BusinessFarmServiceOrderMapper;
import com.ruoyi.project.business.service.IBusinessFarmServiceOrderService;

/**
 * 农田服务订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-22
 */
@Service
public class BusinessFarmServiceOrderServiceImpl implements IBusinessFarmServiceOrderService
{
    @Autowired
    private BusinessFarmServiceOrderMapper businessFarmServiceOrderMapper;

    /**
     * 查询农田服务订单
     * 
     * @param id 农田服务订单ID
     * @return 农田服务订单
     */
    @Override
    public BusinessFarmServiceOrder selectBusinessFarmServiceOrderById(Long id)
    {
        return businessFarmServiceOrderMapper.selectBusinessFarmServiceOrderById(id);
    }

    /**
     * 查询农田服务订单列表
     * 
     * @param businessFarmServiceOrder 农田服务订单
     * @return 农田服务订单
     */
    @Override
    public List<BusinessFarmServiceOrder> selectBusinessFarmServiceOrderList(BusinessFarmServiceOrder businessFarmServiceOrder)
    {
        return businessFarmServiceOrderMapper.selectBusinessFarmServiceOrderList(businessFarmServiceOrder);
    }

    /**
     * 新增农田服务订单
     * 
     * @param businessFarmServiceOrder 农田服务订单
     * @return 结果
     */
    @Override
    public int insertBusinessFarmServiceOrder(BusinessFarmServiceOrder businessFarmServiceOrder)
    {
        businessFarmServiceOrder.setCreateTime(DateUtils.getNowDate());
        return businessFarmServiceOrderMapper.insertBusinessFarmServiceOrder(businessFarmServiceOrder);
    }

    /**
     * 修改农田服务订单
     * 
     * @param businessFarmServiceOrder 农田服务订单
     * @return 结果
     */
    @Override
    public int updateBusinessFarmServiceOrder(BusinessFarmServiceOrder businessFarmServiceOrder)
    {
        businessFarmServiceOrder.setUpdateTime(DateUtils.getNowDate());
        return businessFarmServiceOrderMapper.updateBusinessFarmServiceOrder(businessFarmServiceOrder);
    }

    /**
     * 批量删除农田服务订单
     * 
     * @param ids 需要删除的农田服务订单ID
     * @return 结果
     */
    @Override
    public int deleteBusinessFarmServiceOrderByIds(Long[] ids)
    {
        return businessFarmServiceOrderMapper.deleteBusinessFarmServiceOrderByIds(ids);
    }

    /**
     * 删除农田服务订单信息
     * 
     * @param id 农田服务订单ID
     * @return 结果
     */
    @Override
    public int deleteBusinessFarmServiceOrderById(Long id)
    {
        return businessFarmServiceOrderMapper.deleteBusinessFarmServiceOrderById(id);
    }
}
